"""
双人对战模式界面
"""

import pygame
import sys
from rules import GobangRules
from .base_game import BaseGameGUI


class PvPGameGUI(BaseGameGUI):
    """双人对战游戏界面类"""
    
    def __init__(self, board_size=15, cell_size=40):
        """初始化双人对战界面"""
        super().__init__(board_size, cell_size)
        pygame.display.set_caption("五子棋 - 双人对战")
        self.mode_name = "双人对战"
    
    def handle_player_move(self, row, col):
        """
        处理玩家落子
        :param row: 行坐标
        :param col: 列坐标
        """
        if not self.game_rules.game_over:
            self.game_rules.make_move(row, col)
    
    def ai_move(self):
        """双人模式无需AI落子"""
        pass
    
    def undo_move(self):
        """悔棋 - 双人模式悔一步"""
        self.game_rules.undo_move()
